package com.demo.sentinel;

import com.alibaba.csp.sentinel.cluster.server.ClusterTokenServer;
import com.alibaba.csp.sentinel.cluster.server.SentinelDefaultTokenServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author cyj
 **/
@SpringBootApplication
public class ServiceSentinelApplication {

    public static void main(String[] args) throws Exception {
        // 嵌入模式运行
        SpringApplication.run(ServiceSentinelApplication.class, args);

        // 独立token server
//        aloneTokenServer();
    }

    private static void aloneTokenServer() throws Exception {
        // Not embedded mode by default (alone mode).
        ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();

        // Start the server.
        tokenServer.start();
    }
}
